package cn.wolfcode.p2p.base.query;

import cn.wolfcode.p2p.base.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.StringUtils;

import java.util.Date;

@Setter
@Getter
//登陆日志的高级查询
public class IpLogQueryObject extends QueryObject{
    //当前用户的手机号码
    private String username;

    public String getUsername(){
        return StringUtils.hasLength(username) ? username : null;
    }

    //开始时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;

    //结束时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    public Date getEndDate(){
        return DateUtil.getEndDate(endDate);
    }

    //状态码
    private Long state = -1L;

    //用户类型
    private Long userType = -1L;
}
